package com.penglecode.java7.features.syntax;
/**
 * 在Java7中,允许String类型作为switch语句的条件
 * 
 * @author pengpeng
 * @date 2013-7-23上午9:49:05
 * @version 1.0
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class SwitchTest {

	public static void printWeekDay(String weekDay){
		switch(weekDay){
			case "1" : 
				System.out.println("星期一");
				break;
			case "2" : 
				System.out.println("星期二");
				break;
			case "3" : 
				System.out.println("星期三");
				break;
			case "4" : 
				System.out.println("星期四");
				break;
			case "5" : 
				System.out.println("星期五");
				break;
			case "6" : 
				System.out.println("星期六");
				break;
			case "0" : 
				System.out.println("星期日");
				break;
			default : break;
		}
	}
	
	public static void main(String[] args) {
		String[] weekDays = {"1","2","3","4","5","6","0"};
		for(int i = 0; i < weekDays.length; i++){
			printWeekDay(weekDays[i]);
		}
	}

}
